#include <ctime>
#include <ostream>

class Direction {
private:
	Direction();
	Direction(int const dx, int const dy):
	dx(dx), dy(dy){
		srand((unsigned)time(0));
	}
	//Schovat kopirovaci ctor.
	Direction(Direction const&);
	Direction& operator=(Direction const&  d);

public:
	const int dx;
	const int dy;
	static const size_t count = 8;

	static const Direction& random()
	{
		int _rand = rand() % count;
		switch (_rand)
		{
		case 0:
			return LLU();
		case 1:
			return LLD();
		case 2:
			return RRU();
		case 3:
			return RRD();
		case 4:
			return LUU();
		case 5:
			return LDD();
		case 6:
			return RUU();
		case 7:
			return RDD();
		default:
			throw "cislo ma byt mezi 0 a 7";
		}
		
	}

	static const Direction& LLU()
	{
		static const Direction llu = Direction(-2,1);
		return llu;
	}
	static const Direction& LLD()
	{
		static const Direction lld = Direction(-2,-1);
		return lld;
	}
	static const Direction& RRU()
	{
		static const Direction rru = Direction(2,1);
		return rru;
	}
	static const Direction& RRD()
	{
		static const Direction rrd = Direction(2,-1);
		return rrd;
	}
	static const Direction& LUU()
	{
		static const Direction luu = Direction(-1,2);
		return luu;
	}
	static const Direction& LDD()
	{
		static const Direction ldd = Direction(-1,-2);
		return ldd;
	}
	static const Direction& RUU()
	{
		static const Direction ruu = Direction(1,2);
		return ruu;
	}
	static const Direction& RDD()
	{
		static const Direction rdd = Direction(1,-2);
		return rdd;
	}

	friend std::ostream& operator<< (std::ostream& os, const Direction& d)
	{
		os << '[' << d.dx << ':' << d.dy << ']' ;
		return os;
	}

	virtual ~Direction(void){}

};

